{% extends "base.html" %}
{% load custom_markdown %}
{% block container %}
        <div class="panel-group" id="accordion">
                {% for article in article_list %}
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                <a href="#collapse{{ article.id }}" data-toggle="collapse" data-parent="#accordion">
                                    <h4 class="home_title">
                                        {{ article.title }}
                                    </h4>
                                </a>
                            </h3>
                            <span class="time">{{ article.create_time|date:"Y-M-d  H:j" }}</span>
                        </div>
                        <div id="collapse{{ article.id }}" class="peal-collapse collapse">
                            <div class="peal-body peal_body">
                                {{ article.abstract|custom_markdown }}
                                <a href="{% url 'detail' article.id %} ">详细内容</a>
                            </div>
                        </div>
                    </div>
                {% endfor %}
             </div>


{% endblock %}
{% block right_bar %}
    <div class="panel panel-default">
        <div class="panel-heading">分类</div>
        <div class="panel-body">
            {% for category in category_list %}

                    <a class="btn btn-success" href="{% url 'category' category.id %}">{{ category.name }}</a>
            {% endfor %}
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">标签</div>
        <div class="panel-body">
            {% for tag in tag_list %}
                    <a href="{% url 'tag' tag.id %}"></a>
                <a href="{% url 'tag' tag.id %}" class="btn btn-info tag_list">{{ tag.name }}<span class="badge">{{ tag.length }}</span></a>
            {% endfor %}
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">标签</div>
        <div class="panel-body">
            {% for year,month_list in date_archive %}
                {{year}} 年
                {% for month in month_list %}
                    <a href="{% url 'archive' year month %}"><p>{{ month }} 月</p></a>
                {% endfor %}
            {% endfor %}
        </div>
    </div>
{% endblock %}